/*
 * @Author: 涵崽
 * @Date: 2023-12-25 10:05:53
 * @email: 1045654@qq.com
 * @gitee: https://gitee.com/han-zai
 * @LastEditors: 涵崽
 * @LastEditTime: 2024-02-29 13:01:26
 * @Description: 微信：1045654
 */
import Cookies from 'js-cookie'
import store from '../store'
const TokenKey = 'token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
export function getLang() {
  return store.state.app.language || 'en'
}
export function getAxiosLang() {
  if (store.state.app.language === 'en') {
    return 'en-us'
  } else {
    return 'zh-cn'
  }
}
export function setLang(lang) {
  return store.dispatch('app/setLanguage', lang)
}
